package eerbaar.server.statemachine;

public class State {

    private String simpleName;

    private final String word;

    public State(String word) {
        assert (word != null);
        this.word = word;
    }

    @Override
    public boolean equals(Object obj) {
        State other = (State) obj;
        return this.word.equals(other.word);
    }

    // public String getSpecialChar() {
    // String s = "";
    // for (int i = 0; i < this.word.length(); i++) {
    // char c = this.word.charAt(i);
    // if (!Character.isLetter(c)) {
    // s += c;
    // break;
    // }
    // }
    // return s;
    // }

    public String getSimpleName() {
        return this.simpleName;
    }

    public String getWord() {
        return this.word;
    }

    @Override
    public int hashCode() {
        return toString().hashCode();
    }

    public void setSimpleName(String simpleName) {
        this.simpleName = simpleName;
    }

    public String simpleString() {
        // return getSpecialChar() + this.simpleName;
        return this.simpleName;
    }

    @Override
    public String toString() {
        return this.word;
    }

}
